<?php
function showID($str)
{
    $pid = posix_getpid();
    fprintf(STDOUT,"%s,pid=%d,ppid=%d,gpid=%d,sid=%d,uid=%d,gid=%d\n",
    $str,$pid,posix_getppid(),posix_getpgrp(),posix_getsid($pid),posix_getuid(),posix_getgid()
    );
}
showID("parent:");

$pid = pcntl_fork();
if ($pid==0){
    showID("child:");
    pcntl_exec("09_2.php",array("a","b","c"));
    echo "hello,world\n";
}
$pid = pcntl_wait($status);
if ($pid>0){
    fprintf(STDOUT,"exit pid=%d\n",$pid);
}
